# 算术运算符
x = 10
y = 3
addition = x + y
subtraction = x - y
multiplication = x * y
division = x / y
floor_division = x // y
modulo = x % y
exponentiation = x ** y

print("加法:", addition)
print("减法:", subtraction)
print("乘法:", multiplication)
print("除法:", division)
print("整除:", floor_division)
print("取余:", modulo)
print("幂运算:", exponentiation)

# 比较运算符
a = 5
b = 8
print("等于:", a == b)
print("不等于:", a != b)
print("小于:", a < b)
print("大于:", a > b)
print("小于等于:", a <= b)
print("大于等于:", a >= b)

# 逻辑运算符
p = True
q = False
print("逻辑与:", p and q)
print("逻辑或:", p or q)
print("逻辑非:", not p)

# 赋值运算符
x = 10
x += 5
print("加法赋值:", x)
x -= 2
print("减法赋值:", x)
x *= 3
print("乘法赋值:", x)
x /= 2
print("除法赋值:", x)

# 位运算符
m = 5  # 二进制表示为 0101
n = 3  # 二进制表示为 0011
bitwise_and = m & n
bitwise_or = m | n
bitwise_xor = m ^ n
left_shift = m << 1
right_shift = m >> 1

print("按位与:", bitwise_and)
print("按位或:", bitwise_or)
print("按位异或:", bitwise_xor)
print("左移:", left_shift)
print("右移:", right_shift)

# 成员运算符
my_list = [1, 2, 3, 4, 5]
print("2 存在于列表中:", 2 in my_list)
print("6 存在于列表中:", 6 in my_list)

# 身份运算符
p1 = "hello"
p2 = "hello"
print("p1 和 p2 引用相同的对象:", p1 is p2)

p3 = [1, 2, 3]
p4 = [1, 2, 3]
print("p3 和 p4 引用不同的对象:", p3 is not p4)
